<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/11/23
 * Time: 16:09
 */

namespace User\Model;


use Think\Model;

class UserModel extends Model 
{
    //根据token获取用户id
    public function getIdByToken($token){
        $user_info = M('user')->where(['token'=>$token])->field('userid')->find();
        return $user_info['userid'];
    }
    //根据token获取用户详细信息
    public function getUserInfoByToken($token){
        $user_info = M('userdetail')->where(['token'=>$token])->find();
        return $user_info;
    }
}